import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  // {
  //   path: '/',
  //   name: 'Home',
  //   component: Home
  // },
  {
    path: '/',
    //Manage是页面主体
    component: () => import(/* webpackChunkName: "about" */ '../views/Manage.vue'),
    //首先进入home主页
    redirect: "/user",
    children: [
      {
        path: 'user', name: '用户管理', component: () => import(/* webpackChunkName: "about" */ '../views/User.vue'),
      },
      {
        path: 'home', name: '首页', component: () => import(/* webpackChunkName: "about" */ '../views/Home.vue')
      },
      {
        path: 'wc', name: '卫生间', component: () => import(/* webpackChunkName: "about" */ '../views/Wc.vue')
      },
      // {
      //   path: 'equipment', name: '仪器管理', component: () => import(/* webpackChunkName: "about" */ '../views/Equipment')
      // },
      {
        path: 'admin', name: '管理员管理', component: () => import(/* webpackChunkName: "about" */ '../views/Admin')
      },

    ]
  },
  {
    path: '/about',
    name: 'About',
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '/login',
    name: 'Login',
    component: ()=>import('../views/Login')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
